#! /bin/bash

total=31;
a=7;
b=20;

for exe in  1d-jacobi-apop
do
    rm result/$exe.txt 
    for index in `seq $a $b`;
    do 
    nx=$((2 ** $index))
    t=$((2 ** ($total - $index)))
    ../$exe/exe-$exe $nx $t >> result/$exe.txt 
    done
done
echo -e "size\tscalar\tauto\ton-the-fly\tour\tstride11\tspeedup\tspeedup\tspeedup" > result/$exe.data.txt
cat result/1d-jacobi-apop.txt|tr "," "=" | awk -F "= " '{print $3 "\t" $NF}'|paste - - - - - |awk '{print $1"\t" $2"\t" $4"\t" $6"\t"$8"\t" $10"\t"$6/$4"\t"$8/$4"\t"$10/$4}' >> result/1d-jacobi-apop.data.txt